package com.biaobiaoqi.scoreanalysis.administrator.action;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.biaobiaoqi.scoreanalysis.service.ICourseService;
import com.opensymphony.xwork2.ActionSupport;

public class DeleteCourse extends ActionSupport {
 	private static final long serialVersionUID = -6038826347595088441L;
 	private static final Log log = LogFactory.getLog(DeleteCourse.class);
 	private int id;
 	@Resource
 	private ICourseService courseService;
 	
 	public String execute() {
		log.debug("delete course:"+id);
		try {
			courseService.deleteCourse(id);
			return SUCCESS;
		} catch (Exception e) {
			log.error("delete course failed", e);
			return ERROR;
		}
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public ICourseService getCourseService() {
		return courseService;
	}

	public void setCourseService(ICourseService courseService) {
		this.courseService = courseService;
	}
}
